package com.addressbook.fw;

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Random;

public class DateData {
	private GregorianCalendar gc = new GregorianCalendar();
	private String months[] = new String[]{"January", "February", "March", "April", "May", "June", "July",
											"August", "September", "October", "November", "December"};

	public String getDay() {
		return String.valueOf(gc.get(Calendar.DAY_OF_MONTH));
	}

	public String getMonth() {
		return months[gc.get(Calendar.MONTH)];
	}

	public String getYear() {
		return String.valueOf(gc.get(Calendar.YEAR));
	}

	public void setRandomDate() {
		Random rnd = new Random();
		gc.set(Calendar.YEAR, rnd.nextInt(60) + 1950);
		gc.set(Calendar.DAY_OF_YEAR, rnd.nextInt(365));
	}

}
